home *** CD-ROM | disk | FTP | other *** search
- class Heroes.HeavyObject extends Heroes.WorldObject
- {
- var r;
- var x;
- var z;
- function HeavyObject()
- {
- super();
- if(this.r == -1)
- {
- this.r = this._width / 2;
- }
- }
- function onEnterFrame()
- {
- var _loc5_ = this.x - this._parent.player.x;
- var _loc3_ = this.z - this._parent.player.z;
- var _loc6_ = Math.sqrt(Math.pow(_loc5_,2) + Math.pow(_loc3_,2));
- if(_loc6_ < this.r)
- {
- var _loc4_ = Math.atan2(_loc3_,_loc5_) - 1.5707963267948966;
- this._parent.player.x = this.x + this.r * Math.sin(_loc4_);
- this._parent.player.z = this.z - this.r * Math.cos(_loc4_);
- }
- super.onEnterFrame();
- }
- }
-